home *** CD-ROM | disk | FTP | other *** search
- *Frank -- I couldn't resist this:
- * (Also, my reponse to you saying you're cracked, is to show
- * that I am even more cracked!)
- *
- *
- * GWAIT.S -- Just wait for a key at the keyboard, dinging the bell
- * occasionally.
- *
- *
- * Didnae ken that you guys were annoyed by that wait message. But
- * 7k is too much overhead for me. Here's one in 68000 that rings
- * the bell while weighing in at about 250 bytes. You can plug in
- * whatever message you like at "message:", just remember the 0 byte
- * on the end. Then simply assemble and link this with the batch:
- *
- * as68 -l -u %1.s
- * link68 [u,s] %1.68k=%1
- * relmod %1.68k %1.prg
- * rm %1.68k
- * wait.prg
- *
- *
- * Crazier than Frank,
- *
- * Greywolf.
- *
- .data
-
- CR: .equ $0A
- LF: .equ $0D
-
- delshort: .dc.l 0500 * Short delay between the bells in a set
- * about 1/3 of a sec
- *
- dellong: .dc.l 0300 * Long delay between sets of bells
- * this number times delshort's time for time
- *
- belcnt: .dc.l 02 * Number of bells in a row (set) -1
-
- message: .dc.b CR,LF,LF,'Strike any key when ready...',0
-
- crlflf: .dc.b CR,LF,LF,0
-
- .text
- start:
- lea stack,sp
- lea message,a0
- move.l a0,-(sp)
- move.w #09,-(sp) *bdos prt_str
- trap #1
- *
- addq.l #6,sp
- *
- waitloop:
- bsr threebels
- bsr waitkey
- cmpi.b #0,d0
- beq waitloop
- *
- *
- *
- cmpi.b #03,d0 *did we have a control - C
- beq out *Yes? -- return it as an error (in the hope
- * some future batch program or CLI will be
- * able to pick it up.
- move.w #0,d0 * No? -- then return no error.
- out:
- move.w d0,-(sp) *stuff return code
- lea crlflf,a0 * print two blank lines
- move.l a0,-(sp)
- move.w #09,-(sp) *bdos prt_str
- trap #1
- *
- addq.l #6,sp
- *
- move.w #$04C,-(sp) *term prog (RC is already on the stack)
- exit:
- trap #1
- *
- threebels: *ring the bell
- move.l d0,-(sp)
- move.l belcnt,d0 *number of times
- ringloop:
- move.l d0,-(sp) *push it (I dont trust bdos)
- *
- move.w #07,-(sp) *bell
- move.w #02,-(sp) *conout
- trap #1
- addq.l #4,sp
- bsr shortwait *short delay
- move.l (sp)+,d0 *pop count
- dbf d0,ringloop
- *
- move.l (sp)+,d0
- rts
- *
- shortwait: * Short delay (constantly checking for key)
- move.l d1,-(sp)
- move.l delshort,d1
- swaitloop:
- move.l d1,-(sp) * push the count (I don't trust bdos)
- move.w #$0ff,-(sp) *getchar
- move.w #06,-(sp) *rawconio
- trap #1
- addq.l #04,sp
- move.l (sp)+,d1 * pop the count
- *
- cmpi.l #0,d0 *was there a char?
- dbne d1,swaitloop
- *
- move.l (sp)+,d1
- rts
- *
- *
- waitkey: *long wait between bell sets while checking keyboard
-
- move.l d1,-(sp)
- move.l dellong,d1
- waitkloop:
- bsr shortwait *wait a mo, (and was ther a char)
- *
- cmpi.l #0,d0 *was there a char?
- dbne d1,waitkloop
- *
- move.l (sp)+,d1
- rts *with any got char in d0
- *
- .bss
-
- .ds.l 256 * why not? it costs us no disk space!
- stack: .ds.l 1
-
- .end
-
-
-